/**
 * 
 */
package com.demo2do.strawberry.entity.startup.detail;

/**
 * @author lute
 *
 */
public enum BusinessStatus {
	
	/** 无任何商业运营状态 */
	NULL("enum.business-status.null"),
	
	/** 研发中 */
	DEVELOPING("enum.business-status.developing"),
	
	/** 商业推广中 */
	BUSINESS_PROMOTION("enum.business-status.business-promotion"),
	
	/** 运营中 */
	OPERATING("enum.business-status.operating"),
	
	/** 已盈利 */
	PROFITED("enum.business-status.profited");
	
	private String key;
	
	/**
	 * default constructor
	 */
	private BusinessStatus() {
		
	}
	
	/**
	 * @param key
	 */
	private BusinessStatus(String key) {
		this.key = key;
	}
	
	/**
	 * @return the key to return
	 */
	public String getKey() {
		return this.key;
	}
	
	/**
	 * @return the alias
	 */
	public String getAlias() {
		return this.key.substring(key.lastIndexOf(".") + 1);
	}
	
	/**
	 * @param value
	 * @return
	 */
	public static BusinessStatus aliasOf(String value) {
		for(BusinessStatus status : BusinessStatus.values()) {
			if(status.getAlias().equalsIgnoreCase(value)) {
				return status;
			}
		}
		return null;
	}

}
